package com.sky.web.app;

import com.sky.constant.StatusConstant;
import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("user/category")
public class AppCategoryController {
    @Autowired
    private CategoryService categoryService;
    @GetMapping("list")
    public Result findListByCategory4App(){
        Category category = Category.builder()
                .status(StatusConstant.ENABLE)
                .build();
        List<Category> list = categoryService.findListByCategory4App(category);
        return Result.success(list);
    }

}
